package com.wanxi.test;
//一维数组，随机产生的数据的最大值
import java.util.Random;

public class RandomOneArray {

    public static void main(String[] args) {
        int[] array = new int[7];
        Random random = new Random();
        int length = array.length;
        int max = 0;

        for (int i = 0; i < length; i++) {
            array[i] = random.nextInt(100) + 1;
        }

        for (int i = 0; i < length; i++) {
            max = max > array[i] ? max : array[i];
        }
        System.out.println("最大的数是: " + max);


    }
}
